package com.xhh.nphm.system.service.impl;

import com.xhh.nphm.system.domain.TworkFormLogEty;
import com.xhh.nphm.system.mapper.TworkFormLogDao;
import com.xhh.nphm.system.service.ITworkFormLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TworkFormLogServiceImpl implements ITworkFormLogService {
    @Autowired
    private TworkFormLogDao tworkFormLogDao;

    /**
     * 保存和备份电话记录操作日志
     * @param tworkFormLogEty
     * @return
     */
    @Override
    public int save(TworkFormLogEty tworkFormLogEty) {
        int rows = tworkFormLogDao.insert(tworkFormLogEty);
        return rows;
    }

    /**
     * 工单日志 列表数据
     * @param wfId
     * @return
     */
    @Override
    public List<TworkFormLogEty> logListJson(int wfId) {
        return tworkFormLogDao.logListJson(wfId);
    }

    /**
     * 查找工单日志
     *
     * @param logId 日志id
     * @return
     */
    @Override
    public TworkFormLogEty selectById(Integer logId) {
        return tworkFormLogDao.findById(logId);
    }

    /**
     * 切换日志公开状态
     *
     * @param logId 日志id
     * @return 结果
     */
    @Override
    public int updateState(Integer logId) {
        return tworkFormLogDao.updateState(logId);
    }
}
